<template>
  <div class="setting">  
    <div class="header-box">
        <div class="nickName">
            {{userInfo.nickName}}
        </div>
        <div class="qudao">
            {{userInfo.channelName}}
        </div>
        <div class="iconfont iconshezhi isbtn" @click="$router.push('/setting')"></div>
    </div>
    <row title="我的消息"  isclick  @click.native="$router.push('/messageList')">
      <div slot="rowRight" class="message-num" v-if="messageNum>0">
          {{messageNum}}
      </div>
    </row>
    <!-- <row title="我的店铺" isclick  @click.native="$router.push('/myShops')"></row> -->
    <row title="我的发票" isclick @click.native="$router.push('/myInvoice')" v-show="storeType != 1"></row>
    <row title="设置" isclick @click.native="$router.push('/setting')" ></row>
    <!-- <row title="库存预警" isclick ></row> -->
  </div>

</template>

<script>
import row from '@/components/row'
import api from '@/api/api.js' 
export default { 
  components: {
    row
  },
  data () {
    return {
      userInfo:{},
      messageNum:0,
      storeType : JSON.parse(localStorage.hj_userInfo).storeType
    }
  },
  created(){ 
  },
  mounted () {
    this.getMessageNum()
    this.userInfo = JSON.parse(localStorage.hj_userInfo) 
  },
  filters: {
     
  },
  methods: {
    getMessageNum(){
      // api.messageMng.getUnReadCount({},res=>{ 
      //   this.messageNum=res.result

      // })
      this.messageNum = this.$store.state.messageNum;
    },
  }
}
</script>
<style lang="less" scoped> 
 /deep/.message-num{
    color: #fff;
    width: 20px;
    height: 20px;
    font-size: 6px;
    line-height: 20px;
    background: red;
    border-radius: 10px;
    text-align: center;
}
    .header-box{
        background: #e7e7e7;
        height: 20vh;
        color: #333;
        position: relative;
    }
    .iconshezhi{
        position: absolute;
        right: 10px;
        top: 30px; 
    }
    .nickName{
        font-size: 18px;
        font-weight: bold;
        padding: 30px 32px;
    }
    .qudao{
        padding: 0 32px;
    }
   
    .setting-img{
      width: 100%;
    }
</style>